import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { User } from './user.decorator'

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }
  @Get('/user')
  // 在这里使用的时候 @User("name") 参数传入了 name
  async findOne(@User('name') user: object) {
    console.log('获取到的用户信息是：', user);
  }
}
